cmake_minimum_required(VERSION 2.8)

project(liquid)

include(${CMAKE_SOURCE_DIR}/cmake/standard.cmake)

set(PROJECT_VERSION 0.1.0)
set(PROJECT_DESCRIPTION "liquid programming language")

set(LANG_LIB ${PROJECT_NAME})
set(LANG_CC lqc)

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})

use_clang()

pkg_dependency(EXTERNAL_LIBS glib-2.0 REQUIRED)

list(APPEND EXTERNAL_LIBS gmp)

include_directories(${PROJECT_SOURCE_DIR}/source)

add_subdirectory(source)
add_subdirectory(tools)

if(EXISTS ${PROJECT_SOURCE_DIR}/test)
    message(STATUS "Unittest environment has been downloaded and is found")
    add_subdirectory(test)
else()
    message(STATUS "No Unittest environment found")
endif()

# -----------------------------------------------------------------------------
# install pkg-config configuration for library
# -----------------------------------------------------------------------------
configure_file(cmake/${LANG_LIB}.pc.in ${CMAKE_BINARY_DIR}/${LANG_LIB}.pc @ONLY)

install(FILES ${CMAKE_BINARY_DIR}/${LANG_LIB}.pc DESTINATION lib/pkgconfig)
